package com.warmheart.builder.login;

import com.warmheart.core.co.base.BaseCoBuilder;
import com.warmheart.core.co.oper.Co;
import com.warmheart.entity.login.LoginLog;

/**
 * 
 * @ClassName: LoginLog
 * @Description: 用户登录实体CoBuilder类，对应表名称为tb_login_log
 *               温馨提示：不要修改该实体CoBuilder类的任何字段
 * @author ZhangJianyang
 * @date 2025年06月20日 下午14:00:55
 *
 */
public class LoginLogCoBuilder extends BaseCoBuilder<LoginLog, LoginLogCoBuilder> {

    private final LoginLog t;

    @Override
    protected LoginLogCoBuilder self() {
        return this;
    }

    @Override
    public LoginLog core() {
        return this.t;
    }

    public LoginLogCoBuilder(LoginLog loginLog) {
        t = loginLog;
    }

    /**
     * 用户id
     */
    private Co<LoginLog, LoginLogCoBuilder> userId;

    /**
     * 用户名
     */
    private Co<LoginLog, LoginLogCoBuilder> name;

    /**
     * 用户登录ip地址
     */
    private Co<LoginLog, LoginLogCoBuilder> ipAddress;

    /**
     * 登录状态（01成功02失败）
     */
    private Co<LoginLog, LoginLogCoBuilder> status;

    /**
     * 登录失败原因
     */
    private Co<LoginLog, LoginLogCoBuilder> failReason;

    public Co<LoginLog, LoginLogCoBuilder> userId() {
        if (this.userId == null) {
            this.userId = new Co<LoginLog, LoginLogCoBuilder>(self(), "user_id");
        }
        return this.userId;
    }

    public Co<LoginLog, LoginLogCoBuilder> name() {
        if (this.name == null) {
            this.name = new Co<LoginLog, LoginLogCoBuilder>(self(), "name");
        }
        return this.name;
    }

    public Co<LoginLog, LoginLogCoBuilder> ipAddress() {
        if (this.ipAddress == null) {
            this.ipAddress = new Co<LoginLog, LoginLogCoBuilder>(self(), "ip_address");
        }
        return this.ipAddress;
    }

    public Co<LoginLog, LoginLogCoBuilder> status() {
        if (this.status == null) {
            this.status = new Co<LoginLog, LoginLogCoBuilder>(self(), "status");
        }
        return this.status;
    }

    public Co<LoginLog, LoginLogCoBuilder> failReason() {
        if (this.failReason == null) {
            this.failReason = new Co<LoginLog, LoginLogCoBuilder>(self(), "fail_reason");
        }
        return this.failReason;
    }
}